package com.ljx.poi.controller;

import com.ljx.poi.util.ExcelUtils;
import com.ljx.poi.vo.CertificateListBO;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 李捷禧
 * Date: 2023/7/27
 * ClassName: CourceController
 */

@RestController
@ResponseBody
@RequestMapping("/ex")
public class CourceController {

    @GetMapping("/batch/downLoad")
    public void downLoadExcel(HttpServletResponse response) {
        // service 实现了处理数据得到 list
//        List<CertificateListBO> list = certificateConfigService.getExportList(certificateConfigPageBO);
        ArrayList<CertificateListBO> list = new ArrayList<>();
        CertificateListBO certificateListBO = new CertificateListBO();
        certificateListBO.setCertificateName("ljdd");
        certificateListBO.setCertificateStatus("1");
        list.add(certificateListBO);
        ExcelUtils.exportExcel("CertificateConfig_downLoadExcel.xlsx", response, CertificateListBO.class, list, "证书导出");
    }

}
